package main.testers;

import java.io.File;
import java.util.List;


import datatypes.Antenna;
import datatypes.TerrainType;
import modules.pathloss.CoverageAdapter;
import tools.gis.antennaReader.AntennaSite;
import tools.gis.antennaReader.AntennaSiteReader;
import tools.settings.SettingsAdapter;

/**
 *
 * @author Lynne Vandousselaere
 */
public class CoverageTester {

    public static void main(String[] args) {
        CoverageAdapter ca = CoverageAdapter.getInstance();
        SettingsAdapter sa = SettingsAdapter.getInstance();

        try {
         //  sa.setDefaultFolder(new File("D:\\Documenten\\UGent\\NMO\\Coverage_for_wireless_networks\\src"));
             sa.setDefaultFolder(new File("D:\\GIS\\nmo\\Input\\"));

            sa.addSettings(new File(sa.getDefault_folder(), "gsm.xml"));

            AntennaSiteReader areader = new AntennaSiteReader();
            List<AntennaSite> list = areader.getAntennaSiteList(new File("D:\\GIS\\nmo\\Input\\Bipt antennes Brussels hoofdstedelijk gewest v2.shp"));
            Antenna[] antennas = areader.filterSiteListGUI(list);

            for (int i = 0; i < antennas.length; i++) {
                Antenna a = antennas[i];
                TerrainType terrain = tools.gis.GisTools.getTerrainType(a);
                double radius = ca.getRangeRadius(a);
                System.out.println("Antenna " + i + "  " + a.toString() + " " + terrain + "  has radius " + radius);

                //Geometry cov = ca.getCoverage(a);
                //System.out.println("Antenna " + i + "  " + a.toString() + " " + terrain + "  Coverage:\n" + cov.toString());
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
